package com.itheima.mapper;


import com.itheima.pojo.entity.Order;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Options;
import org.apache.ibatis.annotations.Select;

/**
 * @className OrderMapper
 */
@Mapper
public interface OrderMapper {

    @Insert("insert into t_order (member_id,orderDate,orderType,orderStatus,setmeal_id) values" +
            " (#{memberId},#{orderDate},#{orderType},#{orderStatus},#{setmealId})")
    @Options(useGeneratedKeys = true,keyProperty = "id")
    void insertOrderInfo(Order order); // 添加预约信息

    @Select("select * from t_order where id = #{id}")
    Order selectOrderInfoById(Integer id); // 通过id查询预约信息
}
